package com.niiwoo.activity.event.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description 开户类型
 * @Author zq
 * @Date 2018/3/21
 */
@Getter
@AllArgsConstructor
public enum UserRoleTypeEventEnum {

    GUARANTEECORP(Byte.valueOf("1"), "担保机构"),
    INVESTOR(Byte.valueOf("2"), "投资人"),
    BORROWERS(Byte.valueOf("3"), "借款人"),
    COLLABORATOR(Byte.valueOf("4"), "合作机构"),
    SUPPLIER(Byte.valueOf("5"), "供应商"),
    PLATFORM_MARKETING(Byte.valueOf("6"), "平台营销款账户"),
    PLATFORM_PROFIT(Byte.valueOf("7"), "平台分润账户"),
    PLATFORM_INCOME(Byte.valueOf("8"), "平台收入账户"),
    PLATFORM_INTEREST(Byte.valueOf("9"), "平台派息账户"),
    PLATFORM_ALTERNATIVE_RECHARGE(Byte.valueOf("10"), "平台代充值账户"),
    PLATFORM_FUNDS_TRANSFER(Byte.valueOf("11"), "平台总账户"),
    PLATFORM_URGENT(Byte.valueOf("12"), "垫资账户");

    private Byte type;

    private String desc;

    public static UserRoleTypeEventEnum valueOf(Byte code) {
        for (UserRoleTypeEventEnum typeEventEnum : UserRoleTypeEventEnum.values()) {
            if (code.byteValue() == typeEventEnum.getType()) {
                return typeEventEnum;
            }
        }
        return null;
    }
}
